package com.controller;

import com.bean.Food;
import com.mapper.FoodMapper;
import com.service.FoodService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.stereotype.Service;
import org.springframework.web.bind.annotation.CrossOrigin;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.ResponseBody;

import java.util.List;

@Controller
@CrossOrigin
@ResponseBody
@RequestMapping
public class FoodController implements FoodService {
    @Autowired
    private FoodService foodService;
    @Override
    public List<Food> listFoodByBusinessId(Integer businessId) throws Exception {
        return foodService.listFoodByBusinessId(businessId);
    }

    @Override
    public Food getFoodById(Integer foodId) throws Exception {
        return foodService.getFoodById(foodId);
    }
}
